﻿using PropertyChanged;
using VIA.SiMoJi.Domain.Electronics;
using VIA.SiMoJi.Domain.Inspection;
using VIA.SiMoJi.Domain.Vision;

namespace VIA.SiMoJi.Domain.Option
{
    [AddINotifyPropertyChangedInterface]
    public class BanYunStationOption
    {
        public double AxisPress { get; set; }

        public double K { get; set; } = 870.76;
        //public double K2 { get; set; } = 870.76;
        //public double K3 { get; set; } = 870.76;
        //public double K4 { get; set; } = 870.76;
        //public double K5 { get; set; } = 870.76;
        //public double K6 { get; set; } = 870.76;
        //public double K7 { get; set; } = 870.76;
        public double B = 220.6;
    }

    [Serializable]
    public class BanYunRunningStatus : RunningStatus
    {
        public int CurrentFeedTrayCol { get; set; } = 1;
        public int CurrentNGTrayPoint { get; set; } = 1;
        /// <summary>
        /// 每个吸嘴上是否有产品1-7
        /// </summary>
        public TrayPointStatus[] NozzleStatus { get; set; } = [TrayPointStatus.Empty, TrayPointStatus.Empty, TrayPointStatus.Empty, TrayPointStatus.Empty, TrayPointStatus.Empty, TrayPointStatus.Empty, TrayPointStatus.Empty];
        public double[] ZAxisPositions = new double[7];
        public double[] RAxisPositions = new double[7];
        /// <summary>
        /// 搬运X轴
        /// </summary>
        public double YAxisPositions { get; set; }
        /// <summary>
        /// 搬运Y轴点位
        /// </summary>
        public double XAxisPositions { get; set; }
        /// <summary>
        /// 搬运变距轴点位
        /// </summary>
        public double BJAxisPositions { get; set; }
        /// <summary>
        /// 下相机X轴
        /// </summary>
        public double CameraAxisPositions { get; set; }
        public BanYunRunningStatus() { }
        public BanYunRunningStatus(string name) { Name = name; }
        public void Rest()
        {
            NozzleStatus = [TrayPointStatus.Empty, TrayPointStatus.Empty, TrayPointStatus.Empty, TrayPointStatus.Empty, TrayPointStatus.Empty, TrayPointStatus.Empty, TrayPointStatus.Empty];
        }
        public BanYunRunningStatus Clone()
        {
            return new BanYunRunningStatus()
            {
                Name = this.Name,
                Step = this.Step,
                CurrentFeedTrayCol = this.CurrentFeedTrayCol,
                CurrentNGTrayPoint = this.CurrentNGTrayPoint,
                NozzleStatus = this.NozzleStatus,
                ZAxisPositions = this.ZAxisPositions,
                RAxisPositions = this.RAxisPositions,
                YAxisPositions = this.YAxisPositions,
                XAxisPositions = this.XAxisPositions,
                BJAxisPositions = this.BJAxisPositions,
            };
        }
    }
}